mage log magento 2

72

log magento 2.4.3 -

$writer = new \Zend_Log_Writer_Stream(BP . '/var/log/custom.log');
$logger = new \Zend_Log();
$logger->addWriter($writer);
$logger->info('text message');

logger magento2 -

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Your text message');

log magento 1 -

Mage::log('message',null,'logfile.log',true);
Mage::log(print_r($arr, 1), null, 'logfile.log',true);

Comments

Submit
0 Comments